Non-volatile memory (NVM) devices, such as flash memory devices and solid-state drives (SSDs) have become ubiquitous in a variety of computerized applications. The inherent speed of data fetching from NMV devices, as well as the lack of moving mechanical parts and relative small aspect ratio have made these devices a preferable selection to hard-disk storage systems, in applications ranging from Internet-of-Things (IoT) devices to cloud-based servers.
The internal storage of NVM devices is divided into blocks, also known as “erase blocks”, which are further divided into equally-sized pages, so that each block is a collection of pages. Blocks are defined as the smallest units that can be erased, whereas pages are defined as the smallest units that can be written.
In order to reuse (e.g.: re-write) a page, all the pages belonging to the same block must be erased. Thus, flash devices always write new data into free pages, that have been previously erased, even if a previous version of the data has been written in a different page. When this happens, the page holding the old data becomes invalid, but cannot be re-used until the block holding it is erased in its entirety. The number of times a block can be erased is limited and affects the endurance of the flash device.
Flash devices have an internal garbage-collection (GC) mechanism, responsible for reclaiming invalid pages. The internal GC mechanism scans for candidate blocks to be reclaimed (e.g., blocks that have more invalid pages than valid pages). The valid pages of candidate blocks are read and copied to a new block. Finally, the GC mechanism erases the whole block and marks it as free, so it could be re-used for future writes.
When a host computer writes a data object to an NVM device, it may specify a desired location for the data using a virtual address in an application address space. The virtual address may, for example include a namespace, which can be thought of as a virtual hard drive, and a virtual user block address (UBA), which is an offset from the namespace within the application address space. The NVM device may store the data object in any physical address within the NVM and may also move the data location as a result of GC activity. The NVM implements a translation layer to maintain the association of each data object's application address with the physical address on the NVM device.
Write operations can be divided into two classes: writes generated by the internal GC mechanism and writes generated by the external host computer. The total number of concurrent writes a device can handle is limited, thus it is desirable to minimize the number of write operations generated by the internal GC process so that the flash device will be able to handle more external host write operations. Moreover, reducing the number of GC writes directly reduces the number of required erasure cycles (also known as program-erase (PE) cycles), thus improving the lifetime and endurance of the NVM device.
The write amplification (WA) parameter is a metric used to measure the relation between external write operations and GC write operations, and is defined in the following equation Eq. 1:WA=(External-Writes+GC-Writes)/(External-Writes)   Eq. 1It is desired to keep the WA as low as possible. For example: when WA is equal to 1 (optimal value), there are no GC write operations.
NVM devices use fixed-size user data blocks, and applications are forced to use this user data-block size to store data. Applications that require management of data that is not aligned with an integer product of the user data block size (e.g., file system, database, compressed block device, key/value storage) need to implement their own translation layer and GC mechanism. For example, a key/value application that writes objects of variable sizes, needs to know the virtual user block address (UBA) wherein each data object is stored. If data objects are not aligned to the virtual user data block size, the key/value application will need to reclaim invalid space.
The translation layer and GC mechanism of the application works in parallel to the translation layer and internal GC mechanism of the NVM device, resulting in a non-cooperative duplicated process that increases the WA of the overall system, reduces the performance and shortens the life-span of the NVM device.
A system and a method for combining the management of the GC mechanisms and translation layers, of both the NVM device and application, that would enable storage of variable-sized objects (e.g., compressed data blocks or key/value objects) to be stored in flash media while minimizing the overall WA of the system is therefore desired.